#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int DigitSum(int n)
{
	if (n / 10 == 0)
		return n;
	else
	{
	   int a = 0;
	   a = n % 10;
			return a + DigitSum(n / 10);
	}
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int sum = DigitSum(n);
	printf("%d\n", sum);
	return 0;
}